﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using PowerHub.MES.Entities.ProductPlanning;

namespace PowerHub.MES.Entities.Production;

/// <summary>
/// 生产工单
/// </summary>
[Table("Production_WorkOrder")]
public partial class Production_WorkOrder : BaseEntity
{
    /// <summary>
    /// 工单编号
    /// </summary>
    public string? WorkOrderNO { get; set; }

    /// <summary>
    /// 工单名称
    /// </summary>
    public string? WorkOrderName { get; set; }

    /// <summary>
    /// 批次号
    /// </summary>
    public string? BatchNumber { get; set; }

    /// <summary>
    /// 来源类型
    /// </summary>
    public int? SourceType { get; set; }

    /// <summary>
    /// 产品id
    /// </summary>
    public string? ProductBillId { get; set; }

    /// <summary>
    /// 订单数量
    /// </summary>
    public int? OrderQuantity { get; set; }

    /// <summary>
    /// 预计生产日期
    /// </summary>
    public DateTime? EstimatedProductionDate { get; set; }

    /// <summary>
    /// 预计结束日期
    /// </summary>
    public DateTime? EstimatedEndDate { get; set; }

    /// <summary>
    /// 客户编码
    /// </summary>
    public string? CustomerNO { get; set; }

    /// <summary>
    /// 客户名称
    /// </summary>
    public string? CustomerName { get; set; }

    /// <summary>
    /// 状态 选项：0=待生产，1=生产中，2，生产完成，3，已作废，4，暂停
    /// </summary>
    public int? Status { get; set; }
    /// <summary>
    /// 优先级 选项：0=低，1=中，2=高
    /// </summary>
    public int? Priority { get; set; }

    /// <summary>
    /// 实际生产日期
    /// </summary>
    public DateTime? ActualProductionTime { get; set; }

    /// <summary>
    /// 实际结束日期
    /// </summary>
    public DateTime? ActualEndTime { get; set; }
    /// <summary>
    /// 暂停原因
    /// </summary>
    public string? SuspendReason { get; set; }


    public virtual ProductPlanning_ProductBill? ProductBill { get; set; }

    public virtual ICollection<Production_BillOfMaterials> ProductionWorkOrderBillDetials { get; set; } = new List<Production_BillOfMaterials>();
}
